package com.mde.util;

import java.util.List;

public class Point {
	
	private int id;

	private double lat;
	
	private double lon;
	
	private String name;
	
	public int getId() {
		return id;
	}

	public double getLat() {
		return lat;
	}

	public double getLon() {
		return lon;
	}
	
	public String getName() {
		return name;
	}

	public Point(int id, double lat, double lon) {
		this.id = id;
		this.lat = lat;
		this.lon = lon;
		this.name = "UNDEFINED";
	}
	
	public Point(int id, double lat, double lon, String name) {
		this.id = id;
		this.lat = lat;
		this.lon = lon;
		this.name = name;
	}

	public static Point findPoint(List<Integer> ids, List<Double> lats, List<Double> lons, int id) {
		
		int len = ids.size();
		
		for (int i = 0; i < len; ++i)
			if (id == ids.get(i))
				return new Point(id, lats.get(i), lons.get(i));
		
		return null;	
		
	}
	
	public static Point findPoint(List<Integer> ids, List<Double> lats, 
			List<Double> lons, List<String> names, int id) {
		
		int len = ids.size();
		
		for (int i = 0; i < len; ++i)
			if (id == ids.get(i))
				return new Point(id, lats.get(i), lons.get(i), names.get(i));
		
		return null;	
		
	}
	
}
